/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package lab5cyclebuffer;

/**
 *
 * @author Daryna_Ragimova
 */

    public class Consumer implements Runnable {

    private Buffer buf;

    public Consumer(Buffer buf) {
        this.buf = buf;
    }

    @Override
    public void run() {
        while (true) {
            int i;
            try {
                i = buf.get();
                System.out.println("got " + i);
            } catch (InterruptedException ex) {
                System.out.println("Exception while getting");
            }
        }
    }
}

